<?php
/**
 * Created by PhpStorm.
 * User: shiyi
 * Date: 2018/6/8
 * Time: 18:09
 */
namespace app\api\controller;
use think\Db;

class Boss extends Base {

    //职位列表
    public function jobList(){
        $page = input('page', 1);
        $limit = input('limit', 10);
        $data = Db::name('boss_job')->page($page, $limit)->select();
        $count = Db::name('boss_job')->count();
        return $this->formatData($data, $count);
    }

    //公司列表
    public function companyList(){
        $page = input('page', 1,'int');
        $limit = input('limit', 10,'int');
        $data = Db::name('boss_company')->page($page, $limit)->select();
        $count = Db::name('boss_company')->count();
        return $this->formatData($data, $count);
    }

    //公司详情
    public function companyInfo(){
        $name = input('name','');
        if($name == '')
            return ['code'=>403,'msg'=>'非法参数'];
        return Db::name('boss_company')->where(['name'=>$name])->find();
    }

}